﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using devtm.Collections;
using System.Collections.ObjectModel;
using System.Windows;

namespace devtm.Editor.Configuration.Messages
{


    public enum TypeMessage
    {
        Information,
        Error
    }


    public class MessageText
    {

        public MessageText()
        {
            this.Key = Guid.NewGuid().ToString();
        }

        public MessageText(ObservableCollection<MessageText> list, string message, TypeMessage type) : this()
        {
            this.List = list;
            Message = message;
            Type = type;
        }

        public string Label     { get; set; }
        public string Message   { get; set; }
        public TypeMessage Type { get; set; }
        public Action Action    { get; set; }

        public void Run()
        {
            if (Action != null)
                Action();
        }

        public Visibility Show
        {
            get 
            {
                if (Action != null)
                    return Visibility.Visible;

                return Visibility.Collapsed;

            }

        }

        public ObservableCollection<MessageText> List { get; set; }

        public string Key { get; set; }
    }
}
